import { RouteRecordRaw } from 'vue-router'
import CateList from '../views/base/CateList.vue'
import BasicData from '../views/base/BasicData.vue'

const contractRoutes: Array<RouteRecordRaw> = [
  {
    path: '/contract',
    redirect: '/contract/cate',
    name: 'Contract',
    meta: { title: '合同模块', icon: 'contract' },
    children: [
      {
        path: 'cate',
        component: CateList,
        name: 'ContractCate',
        meta: { title: '合同分类', icon: 'category' },
      },
      {
        path: 'product',
        component: BasicData,
        name: 'ContractProduct',
        meta: { title: '产品列表', icon: 'product' },
      },
      {
        path: 'services',
        component: BasicData,
        name: 'ContractServices',
        meta: { title: '服务内容', icon: 'service' },
      },
      {
        path: 'supplier',
        component: BasicData,
        name: 'ContractSupplier',
        meta: { title: '供应商列表', icon: 'supplier' },
      },
      {
        path: 'purchasedcate',
        component: CateList,
        name: 'ContractPurchasedCate',
        meta: { title: '采购品分类', icon: 'category' },
      },
      {
        path: 'purchased',
        component: BasicData,
        name: 'ContractPurchased',
        meta: { title: '采购品列表', icon: 'purchased' },
      },
      {
        path: 'sale-contract',
        component: () => import('../views/contract/SaleContract.vue'),
        name: 'SaleContractList',
        meta: { title: '销售合同', icon: 'sale-contract' },
      },
      {
        path: 'contract-archive',
        component: () => import('../views/contract/SaleContractArchiveList.vue'),
        name: 'ArchiveContract',
        meta: { title: '合同归档', icon: 'archive-contract' },
      },
      {
        path: 'contract-stop',
        component: () => import('../views/contract/SaleContractStopList.vue'),
        name: 'StopContract',
        meta: { title: '中止合同', icon: 'stop-contract' },
      },
      {
        path: 'contract-void',
        component: () => import('../views/contract/SaleContractVoidList.vue'),
        name: 'VoidContract',
        meta: { title: '作废合同', icon: 'void-contract' },
      },
    ],
  },
]

export default contractRoutes
